package router

import "github.com/gin-gonic/gin"

type Register func(*gin.Engine)

func Init(routers ...Register) *gin.Engine {
	rs := append([]Register{}, routers...)

	// 加了Logger(), Recovery() 中间件
	r := gin.Default()

	for _, register := range rs {
		register(r)
	}

	return r
}
